package com.thingple.usb.session;

import android.hardware.usb.UsbAccessory;

import com.thingple.usb.listener.SessionTraceListener;
import com.thingple.usb.listener.StreamDownListener;
import com.thingple.usb.listener.StreamUpListener;
import com.thingple.usb.manager.UsbErrorListener;

public interface UsbSession {

    UsbAccessory getDevice();

    void setErrorListener(UsbErrorListener listener);
    void setTraceListener(SessionTraceListener listener);
    void setStreamUpListener(StreamUpListener listener);
    void setStreamDownListener(StreamDownListener listener);

    void write(byte[] payload);
    void writeAsync(byte[] payload);

    void destroy();
    void start();
    void stop();

    void setMaxRework(int max);
    void setReworkEnable(boolean enable);
    void setAutoResetRework(boolean enable);
    void setReworkDelay(long delay);
}
